import 'dart:convert';

import 'package:largefriends/entity/entities/lf_photo_entity.dart';
import 'package:largefriends/entity/json/json_parse_utils.dart';

class LfAlbumEntity {
  LfAlbumEntity({
    this.photos,
  });

  factory LfAlbumEntity.fromJson(Map<dynamic, dynamic> jsonRes) {
    return LfAlbumEntity(
      photos: jsonRes.asList('photos', (json) => LfPhotoEntity.fromJson(json)),
    );
  }

  List<LfPhotoEntity>? photos;

  @override
  String toString() {
    return jsonEncode(this);
  }

  Map<String, dynamic> toJson() => <String, dynamic>{
        'photos': jsonEncode(photos),
      };
}
